<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>APP管理 | 部门管理</title>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
          page. However, you can choose any other skin. Make sure you
          apply the skin class to the body tag so the changes take effect.
    -->
  <link rel="stylesheet" href="../dist/css/skins/_all-skins.min.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- zTree -->
  <link rel="stylesheet" href="../plugins/zTree_v3/css/zTreeStyle/zTreeStyle.css">
  <link rel="stylesheet" href="../dist/css/communal.css">
  <style type="text/css" media="screen">
    ul.ztree {
      margin-top: 10px;
      border: 1px solid #E4E4E4;
      background: #ffffff;
      min-height:680px; 
      overflow-x:auto;
    }
    .ztree li span{
      padding: 0 2px;   
    }
  </style>
</head>

<body class="hold-transition skin-yellow sidebar-mini">
  <div class="wrapper">
    <!-- Main Header -->
    <header class="main-header">
      <!-- Logo -->
      <a href="../index.html" class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <span class="logo-mini">
          <b>舆情</b>
        </span>
        <!-- logo for regular state and mobile devices -->
        <span class="logo-lg">
          <b>舆情监测</b>
        </span>
      </a>

      <!-- Header Navbar -->
      <nav class="navbar navbar-static-top" role="navigation">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
          <span class="sr-only">Toggle navigation</span>
        </a>
        <!-- Navbar Right Menu -->
        <div class="navbar-custom-menu">
          <ul class="nav navbar-nav">
            <!-- Messages: style can be found in dropdown.less-->
            <li class="dropdown messages-menu">
              <!-- Menu toggle button -->
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <i class="fa fa-envelope-o"></i>
                <span class="label label-success">4</span>
              </a>
              <ul class="dropdown-menu">
                <li class="header">You have 4 messages</li>
                <li>
                  <!-- inner menu: contains the messages -->
                  <ul class="menu">
                    <li>
                      <!-- start message -->
                      <a href="#">
                        <div class="pull-left">
                          <!-- User Image -->
                          <img src="../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
                        </div>
                        <!-- Message title and timestamp -->
                        <h4>
                          Support Team
                          <small>
                            <i class="fa fa-clock-o"></i> 5 mins</small>
                        </h4>
                        <!-- The message -->
                        <p>Why not buy a new awesome theme?</p>
                      </a>
                    </li>
                    <!-- end message -->
                  </ul>
                  <!-- /.menu -->
                </li>
                <li class="footer">
                  <a href="#">See All Messages</a>
                </li>
              </ul>
            </li>
            <!-- /.messages-menu -->

            <!-- Notifications Menu -->
            <li class="dropdown notifications-menu">
              <!-- Menu toggle button -->
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <i class="fa fa-bell-o"></i>
                <span class="label label-warning">10</span>
              </a>
              <ul class="dropdown-menu">
                <li class="header">You have 10 notifications</li>
                <li>
                  <!-- Inner Menu: contains the notifications -->
                  <ul class="menu">
                    <li>
                      <!-- start notification -->
                      <a href="#">
                        <i class="fa fa-users text-aqua"></i> 5 new members joined today
                      </a>
                    </li>
                    <!-- end notification -->
                  </ul>
                </li>
                <li class="footer">
                  <a href="#">View all</a>
                </li>
              </ul>
            </li>
            <!-- Tasks Menu -->
            <li class="dropdown tasks-menu">
              <!-- Menu Toggle Button -->
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <i class="fa fa-flag-o"></i>
                <span class="label label-danger">9</span>
              </a>
              <ul class="dropdown-menu">
                <li class="header">You have 9 tasks</li>
                <li>
                  <!-- Inner menu: contains the tasks -->
                  <ul class="menu">
                    <li>
                      <!-- Task item -->
                      <a href="#">
                        <!-- Task title and progress text -->
                        <h3>
                          Design some buttons
                          <small class="pull-right">20%</small>
                        </h3>
                        <!-- The progress bar -->
                        <div class="progress xs">
                          <!-- Change the css width attribute to simulate progress -->
                          <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
                            <span class="sr-only">20% Complete</span>
                          </div>
                        </div>
                      </a>
                    </li>
                    <!-- end task item -->
                  </ul>
                </li>
                <li class="footer">
                  <a href="#">View all tasks</a>
                </li>
              </ul>
            </li>
            <!-- User Account Menu -->
            <li class="dropdown user user-menu">
              <!-- Menu Toggle Button -->
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <!-- The user image in the navbar-->
                <img src="../dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
                <!-- hidden-xs hides the username on small devices so only the image appears. -->
                <span class="hidden-xs">我的账户</span>
              </a>
              <ul class="dropdown-menu">
                <!-- The user image in the menu -->
                <li class="user-header">
                  <img src="../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
                  <p>
                    Alexander Pierce - Web Developer
                    <small>Member since Nov. 2012</small>
                  </p>
                </li>
                <!-- Menu Body -->
                <li class="user-body">
                  <div class="col-xs-4 text-center">
                    <a href="#">Followers</a>
                  </div>
                  <div class="col-xs-4 text-center">
                    <a href="#">Sales</a>
                  </div>
                  <div class="col-xs-4 text-center">
                    <a href="#">Friends</a>
                  </div>
                </li>
                <!-- Menu Footer-->
                <li class="user-footer">
                  <div class="pull-left">
                    <a href="#" class="btn btn-default btn-flat">Profile</a>
                  </div>
                  <div class="pull-right">
                    <a href="#" class="btn btn-default btn-flat">Sign out</a>
                  </div>
                </li>
              </ul>
            </li>
            <!-- Control Sidebar Toggle Button -->
            <li>
              <a href="#" data-toggle="control-sidebar">
                <i class="fa fa-gears"></i>
              </a>
            </li>
          </ul>
        </div>
      </nav>
    </header>
    <!-- Left Menu -->
    <aside class="main-sidebar">
      <section class="sidebar">
        <div class="user-panel">
          <div class="pull-left image">
            <img src="../dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
          </div>
          <div class="pull-left info">
            <p>我的账户</p>
            <a href="#">
              <i class="fa fa-circle text-success"></i>在线</a>
          </div>
        </div>
        <form action="#" method="get" class="sidebar-form">
          <div class="input-group">
            <input type="text" name="q" class="form-control" placeholder="Search...">
            <span class="input-group-btn">
              <button type="submit" name="search" id="search-btn" class="btn btn-flat">
                <i class="fa fa-search"></i>
              </button>
            </span>
          </div>
        </form>
        <ul class="sidebar-menu">
          <!-- <li class="header">MAIN NAVIGATION</li> -->
          <li class="treeview">
            <a href="../index.html">
              <i class="fa fa-home"></i>
              <span>总 览</span>
              <i class="fa fa-angle-left pull-right"></i>
            </a>
          </li>
          <li class="treeview">
            <a href="../index2.html">
              <i class="fa fa-area-chart"></i>
              <span>舆情监测</span>
              <!-- <span class="label label-primary pull-right">4</span> -->
              <i class="fa fa-angle-left pull-right"></i>
            </a>
          </li>
          <li class="treeview">
            <a href="#">
              <i class="fa fa-users"></i>
              <span>用户管理</span>
              <i class="fa fa-angle-left pull-right"></i>
            </a>
            <ul class="treeview-menu active">
              <li>
                <a href="../custormer/app-custorm_mg.html">
                  <i class="fa fa-circle-o"></i> app用户管理</a>
              </li>
              <li>
                <a href="../custormer/web-custorm_mg.html">
                  <i class="fa fa-circle-o"></i> web用管理户</a>
              </li>
              <li>
                <a href="../custormer/roles.html">
                  <i class="fa fa-circle-o"></i> 角色管理</a>
              </li>
            </ul>
          </li>
          <li>
            <a href="../fulltext_searching.html">
              <i class="fa fa-search-minus"></i>
              <span>全文搜素</span>
              <!-- <small class="label pull-right bg-red">3</small> -->
              <i class="fa fa-angle-left pull-right"></i>
            </a>
          </li>
          <li class="treeview active">
            <a href="#">
              <i class="fa fa-android"></i>
              <span>App管理</span>
              <i class="fa fa-angle-left pull-right"></i>
              <ul class="treeview-menu">
                <li class="active">
                  <a href="../app_management/divisional.html">
                    <i class="fa fa-circle-o"></i> 部门管理</a>
                </li>
                <li>
                  <a href="../app_management/grouping.html">
                    <i class="fa fa-circle-o"></i> 分组管理</a>
                </li>
              </ul>
            </a>
          </li>
          <li class="treeview">
            <a href="#">
              <i class="fa fa-gear"></i>
              <span>系统设置</span>
              <i class="fa fa-angle-left pull-right"></i>
            </a>
            <ul class="treeview-menu">
              <li>
                <a href="#">
                  <i class="fa fa-calendar-minus-o"></i> 日志管理
                  <i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                  <li>
                    <a href="../system/page/customer_login_logs.html">
                      <i class="fa fa-circle-o"></i> 用户登录日志</a>
                  </li>
                  <li>
                    <a href="../system/page/app_login_logs.html">
                      <i class="fa fa-circle-o"></i> app用户登录日志</a>
                  </li>
                  <li>
                    <a href="../system/page/client_push_center.html">
                      <i class="fa fa-circle-o"></i> 客户端push中心日志</a>
                  </li>
                  <li>
                    <a href="../system/page/client_push_logs.html">
                      <i class="fa fa-circle-o"></i> 客户端推送日志</a>
                  </li>
                </ul>
              </li>
              <li>
                <a href="#">
                  <i class="fa fa-laptop"></i> 偏好设置
                  <i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                  <li>
                    <a href="../system/page/source_site_setting.html">
                      <i class="fa fa-circle-o"></i> 来源网站设置</a>
                  </li>
                  <li>
                    <a href="../system/page/morris_conditions_setting.html">
                      <i class="fa fa-circle-o"></i> 默认监测条件</a>
                  </li>
                </ul>
              </li>
              <li>
                <a href="../system/yj_setting.html">
                  <i class="fa fa-circle-o"></i> 预警设置</a>
              </li>
              <li>
                <a href="../system/txl_setting.html">
                  <i class="fa fa-circle-o"></i> 通讯录管理</a>
              </li>
              <li>
                <a href="../system/fsjl_setting.html">
                  <i class="fa fa-circle-o"></i> 发送记录</a>
              </li>
              <li>
                <a href="../system/xzzq_setting.html">
                  <i class="fa fa-circle-o"></i> 新增抓取</a>
              </li>
            </ul>
          </li>
          <li class="treeview">
            <a href="../profile.html">
              <i class="fa fa-user"></i>
              <span>个人中心</span>
              <i class="fa fa-angle-left pull-right"></i>
            </a>
          </li>
        </ul>
      </section>
      <!-- /.sidebar -->
    </aside>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <section class="content-header">
        <h1>
          部门管理
          <!-- <small>Optional description</small> -->
        </h1>
        <ol class="breadcrumb">
          <li><a href="javascript::;"><i class="fa fa-android"></i>app 管理</a></li>
          <li class="active">部门管理</li>
        </ol>
      </section>
      <!-- Main content -->
      <div class="content">
        <div class="box">
          <div class="box-body">
            <div class="row">
              <div class="col-xs-12 col-sm-3">
                <div style="min-height: 300px;border: 1px solid #bfbfbf;overflow-y: scroll;">
                  <ul id="treeDemo" class="ztree"></ul>
                </div>
              </div>
              <div class="col-xs-12 col-sm-9">
                <div class="table-lists panel panel-default">
                  <div class="panel-heading">
                    <form action="" class="form-inline">
                      <div class="form-group">
                        <label for="">匹配关键字</label>
                        <input type="text" class="form-control" placeholder="账户名/姓名/联系手机">
                      </div>
                      <div class="form-group">
                        <button type="button" class="btn btn-warning">查询</button>
                      </div>
                      <div class="pull-right">
                        <button type="button" class="btn btn-warning">添加部门用户</button>
                        <button type="button" class="btn btn-default">删除</button>
                      </div>
                    </form>
                  </div>
                  <div class="panel-body">
                    <table class="table table-bordered table-hover table-stripes">
                      <thead>
                        <tr>
                          <th>
                            <input type="checkbox" name="" id="">
                          </th>
                          <th>账户名</th>
                          <th>姓名</th>
                          <th>部门</th>
                          <th>联系手机</th>
                          <th>创建时间</th>
                          <th>状态</th>
                          <th>操作</th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr>
                          <td>
                            <input type="checkbox" name="" id="">
                          </td>
                          <td>bgqw001</td>
                          <td>北关区委</td>
                          <td>用户组5</td>
                          <td>13523598069</td>
                          <td>2017-05-11 09:42:05</td>
                          <td>
                            <span class="label label-success">正常</span>
                          </td>
                          <td>
                            <button type="button" data-toggle="modal" data-target="#deleteModal" class="btn btn-warning btn-sm">删除</button>
                          </td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                  <div class="box-footer clearfix">
                    <div class="row">
                      <div class="col-sm-6">
                          <span style="line-height: 30px;color: red;">
                            *该组已有 5个用户
                          </span>
                      </div>
                      <div class="col-sm-6 clearfix">
                        <ul class="pagination pagination-sm pull-right no-margin no-padding">
                          <li class="disabled">
                            <a href="#">首页</a>
                          </li>
                          <li class="disabled">
                            <a href="#">上一页</a>
                          </li>
                          <li class="active">
                            <a href="#">1</a>
                          </li>
                          <li class="disabled">
                            <a href="#">下一页</a>
                          </li>
                        </ul>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="table-tips hide panel panel-default">
                  <div class="panel-body">
                    <!-- 没有设局时，给予提示！ -->
                    <div class="text-center" style="margin-top: 30px;">
                        <div style="display: inline-block;width: 80px;height: 80px;border-radius: 50%;border: 1px solid #eee;margin-bottom: 10px;">
                          <span class="fa fa-user" style="line-height: 80px;font-size: 50px;color: #efefef;"></span>
                        </div>
                        <p>暂无人员</p>
                        <p>请添加用户组并在用户组下选择用户！</p>
                    </div><!-- /. 没有设局时，给予提示！ -->
                  </div>
                </div>
                <div id="empty_group" class="panel panel-default hide">
                  <div class="panel-body">
                    <!-- 没有设局时，给予提示！ -->
                    <div class="text-center" style="margin-top: 30px;">
                      <div style="display: inline-block;width: 80px;height: 80px;border-radius: 50%;border: 1px solid #eee;margin-bottom: 10px;">
                        <span class="fa fa-user" style="line-height: 80px;font-size: 50px;color: #efefef;"></span>
                      </div>
                      <p>暂无人员</p>
                      <p>点击以下按钮添加人员</p>
                      <p>
                        <button type="button" class="btn btn-warning btn-sm">
                          <i class="fa fa-plus"></i>添加人员
                        </button>
                      </p>
                    </div><!-- /. 没有设局时，给予提示！ -->
                  </div>
                  <div class="box-footer clearfix">
                    <div class="row">
                      <div class="col-sm-6">
                          <span style="line-height: 30px;color: red;">
                            *该组已有 5个用户
                          </span>
                      </div>
                      <div class="col-sm-6 clearfix">
                        <ul class="pagination pagination-sm pull-right no-margin no-padding">
                          <li class="disabled">
                            <a href="#">首页</a>
                          </li>
                          <li class="disabled">
                            <a href="#">上一页</a>
                          </li>
                          <li class="active">
                            <a href="#">1</a>
                          </li>
                          <li class="disabled">
                            <a href="#">下一页</a>
                          </li>
                        </ul>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- /.content-wrapper -->

    <!-- Main Footer -->
    <footer class="main-footer">
      <!-- To the right -->
      <div class="pull-right hidden-xs">
        Anything you want
      </div>
      <!-- Default to the left -->
      <strong>Copyright &copy; 2015
        <a href="#">Company</a>.</strong> All rights reserved.
    </footer>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
      <!-- Create the tabs -->
      <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
        <li class="active">
          <a href="#control-sidebar-home-tab" data-toggle="tab">
            <i class="fa fa-home"></i>
          </a>
        </li>
        <li>
          <a href="#control-sidebar-settings-tab" data-toggle="tab">
            <i class="fa fa-gears"></i>
          </a>
        </li>
      </ul>
      <!-- Tab panes -->
      <div class="tab-content">
        <!-- Home tab content -->
        <div class="tab-pane active" id="control-sidebar-home-tab">
          <h3 class="control-sidebar-heading">Recent Activity</h3>
          <ul class="control-sidebar-menu">
            <li>
              <a href="javascript::;">
                <i class="menu-icon fa fa-birthday-cake bg-red"></i>
                <div class="menu-info">
                  <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>
                  <p>Will be 23 on April 24th</p>
                </div>
              </a>
            </li>
          </ul>
          <!-- /.control-sidebar-menu -->

          <h3 class="control-sidebar-heading">Tasks Progress</h3>
          <ul class="control-sidebar-menu">
            <li>
              <a href="javascript::;">
                <h4 class="control-sidebar-subheading">
                  Custom Template Design
                  <span class="label label-danger pull-right">70%</span>
                </h4>
                <div class="progress progress-xxs">
                  <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
                </div>
              </a>
            </li>
          </ul>
          <!-- /.control-sidebar-menu -->

        </div>
        <!-- /.tab-pane -->
        <!-- Stats tab content -->
        <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
        <!-- /.tab-pane -->
        <!-- Settings tab content -->
        <div class="tab-pane" id="control-sidebar-settings-tab">
          <form method="post">
            <h3 class="control-sidebar-heading">General Settings</h3>
            <div class="form-group">
              <label class="control-sidebar-subheading">
                Report panel usage
                <input type="checkbox" class="pull-right" checked>
              </label>
              <p>
                Some information about this general settings option
              </p>
            </div>
            <!-- /.form-group -->
          </form>
        </div>
        <!-- /.tab-pane -->
      </div>
    </aside>
    <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
           immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>

    <!-- 删除确认 -->
    <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header" style="color: #fff;background: #f39c12;">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel3">删除信息</h4>
          </div>
          <div class="modal-body">
            <div class="text-center">
                请选择需要删除的信息？
            </div>
          </div>
          <div class="modal-footer">
            <div class="text-center">
                <button type="button" class="btn btn-success" data-dismiss="modal">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
          </div>
        </div>
      </div>
    </div><!-- /.删除确认 -->
    

    <input type=hidden name="checkedIds" id="checkedIds"  >
    <input type="hidden" name="deptId" id="deptId" >
    <input type="hidden" name="isParent" id="isParent" >
    <input type="hidden" name="ids" id="ids">
    <input type="hidden" name="pids" id="pids">
    <input type="hidden" name="deptName" id="deptName">

  </div>
  <!-- ./wrapper -->

  <!-- REQUIRED JS SCRIPTS -->

  <!-- jQuery 2.1.4 -->
  <script src="../plugins/jQuery/jQuery-2.1.4.min.js"></script>
  <!-- Bootstrap 3.3.5 -->
  <script src="../bootstrap/js/bootstrap.min.js"></script>
  <script src="../dist/js/bootstrap-treeview.min.js"></script>
  <script type="text/javascript" src="../plugins/zTree_v3/js/jquery.ztree.core.min.js"></script>
  <script type="text/javascript" src="../plugins/zTree_v3/js/jquery.ztree.all.min.js"></script>
  <script type="text/javascript" .src="../plugins/zTree_v3/js/jquery.ztree.excheck.min.js"></script>

  <!-- AdminLTE App -->
  <script src="../dist/js/app.min.js"></script>
  <script>
    // 全选
    $('.chk_all').on('click', function () {
      $('input[name="chk_list"]').attr('checked');
      $('input[name="chk_list"]').prop('checked', $(this).prop('checked'));
    })
  </script>
  
  
  <script type="text/javascript">
    $(document).ready(function(){
      var setting = {
        view: {
          addHoverDom: addHoverDom,
          removeHoverDom: removeHoverDom,
          // addDiyDom: addDiyDom
        },
        callback: {
          onClick:onClick,
        },
        //编辑模式属性设置
        edit:{
          enable:true,
          editNameSelectAll:true,
          removeTitle:"删除",
          renameTitle:"重命名",
          showRemoveBtn:setRemoveBtn,
          showRenameBtn:setRenameBtn
        }
      };

      var zNodes =[{
          id:1, 
          name:"全部", 
          pId:0,
          open:true, 
          noR:true,
          children:[
             {
              id:11, 
              pId: 1,
              name:"北京", 
              noR:true,
              children: [
                {
                  id:111, 
                  pId: 11,
                  name:"网站", 
                  noR:true
                },{
                  id:112, 
                  pId: 11,
                  name:"报刊", 
                  noR:true
                },{
                  id:113, 
                  pId: 11,
                  name:"论坛", 
                  noR:true
                },{
                  id:114, 
                  pId: 11,
                  name:"博客", 
                  noR:true
                },{
                  id:115, 
                  pId: 11,
                  name:"用户组1", 
                  noR:true
                }
              ]
            },{
              id:12, 
              name:"天津",
              pId: 1,
              noR:true,
              children: [
                {
                  id:121, 
                  pId: 12,
                  name:"网站", 
                  noR:true
                },{
                  id:123, 
                  pId: 12,
                  name:"报刊", 
                  noR:true
                },{
                  id:124, 
                  pId: 12,
                  name:"论坛", 
                  noR:true
                }
              ]
            }
          ]}
        ];
      //   

      //控制删除按钮的显示与隐藏
      function setRemoveBtn(treeId,treeNode){
        if(treeNode.id==0){
          return false;
        }return true;
      }
      //控制修改按钮的显示与隐藏
        function setRenameBtn(treeId,treeNode){
        if(treeNode.id==0){
          return false;
        }return true;
      }


      // hover 效果
      function addHoverDom(treeId, treeNode) {
        var aObj = $("#"+treeNode.tId+"_span");
        var ids = document.getElementById("ids").value;
        //两个按钮id分别要进行判断，然后返回，不然会出现鼠标移出移进时不断循环创建按钮的问题
        //被坑了半个小时，切记
        if( treeNode.editNameFlag ||$("#addCus_"+treeNode.id).length>0) return;
        if( treeNode.editNameFlag ||$("#addStru_"+treeNode.id).length>0) return;

        var addStr = "<span class='add' id='addCus_" + treeNode.id + "' title='新建用户组' onfocus='this.blur();'>"
                      +"<img src='../dist/img/xt/user.png' alt=''>"
                    +"</span>"
                    +"<span class='add2' id='addStru_" + treeNode.id + "' title='新建结构组' onfocus='this.blur();'  >"
                    +"<img src='../dist/img/xt/structure16.png' alt=''></span>";

          if(treeNode.isParent){
            aObj.append(addStr);
          }
        //addBtn:新增内容组按钮   addBtn2:新增结构组按钮
        var addBtn = $("#addCus_"+treeNode.id);
        var addBtn2 = $("#addStru_"+treeNode.id);

        if(addBtn) addBtn.bind("click",function(){
          // 重置刷新
          $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        });
        if(addBtn2) addBtn.bind("click",function(){
          // 重置刷新
          $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        })

      };

      //鼠标移出节点，按钮消失
      function removeHoverDom(treeId, treeNode) {
        $("#addCus_"+treeNode.id).unbind().remove();
        $("#addStru_"+treeNode.id).unbind().remove();
      };

      // 点击切换
      function onClick(event, treeId, treeNode){
        console.log(treeNode)
        if(!treeNode.children){
          console.log(treeNode.tId + ", " + treeNode.name);
          if(treeNode.name == "用户组1"){
            $(".table-lists").addClass('hide');
            $(".table-tips").addClass('hide');
            $("#empty_group").removeClass('hide');
          }else{
            $(".table-tips").removeClass('hide');
            $(".table-lists").addClass('hide');
            $("#empty_group").addClass('hide');
          }
        }else{
          $(".table-lists").removeClass('hide');
          $(".table-tips").addClass('hide');
          $("#empty_group").addClass('hide');
        }
      }


      // 左侧树形结构
      $.fn.zTree.init($("#treeDemo"), setting, zNodes);
      
    })
  </script>

</body>

</html>